package com.example.lxh.testinfo;

import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import adapter.PagerViewAdapter;

public class PicChartActivity extends AppCompatActivity {
    private ViewPager m_viewpager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pic_chart);
        m_viewpager = findViewById(R.id.View_pager);
        LayoutInflater lf = getLayoutInflater().from(this);
        View view1 = lf.inflate(R.layout.viewpagerlayout, null);
        View view2 = lf.inflate(R.layout.viewpagerlayout, null);
        View view3 = lf.inflate(R.layout.viewpagerlayout, null);
        View view4 = lf.inflate(R.layout.viewpagerlayout, null);
        View view5 = lf.inflate(R.layout.viewpagerlayout, null);
        View view6 = lf.inflate(R.layout.viewpagerlayout, null);
        View view7 = lf.inflate(R.layout.viewpagerlayout, null);
        List<View> lists = new ArrayList<>();
        lists.add(view1);

        lists.add(view2);
        lists.add(view3);
        lists.add(view4);
        lists.add(view5);
        lists.add(view6);
        lists.add(view7);
        m_viewpager.setAdapter(new PagerViewAdapter(lists, this));
        m_viewpager.setCurrentItem(0);
    }
}
